/**
 * Project Name:culiulib File Name:BasePresenter.java Package Name:com.culiu.core.fragment.presenter Date:2014-10-24上午2:32:54
 * Copyright (c) 2014, adison All Rights Reserved.
 */

package com.kikikeji.weizhuo.activity.core;

import android.os.Bundle;

public abstract class BasePresenter<U extends BaseUI> implements BasePresenterInterface {

    private U mUi;

    private BaseCoreActivity mActivity;

    private BaseCoreFragment mFragment;

    public void onFragmentAttach(BaseCoreActivity activity, BaseCoreFragment fragment) {
        mActivity = activity;
        mFragment = fragment;
    }

    public void onUiReady(U ui, BaseCoreActivity activity) {
        mUi = ui;
        mActivity = activity;
    }

    public final void onUiDestroy(U ui) {
        onUiUnready(ui);
        mUi = null;
    }

    public void onUiUnready(U ui) {
    }

    public U getUi() {
        return mUi;
    }

    public BaseCoreActivity getActivity() {
        return mActivity;
    }

    public BaseCoreFragment getFragment() {
        return mFragment;
    }

    @Override
    public void onCreate(Bundle bundle) {
    }

    @Override
    public void onStart() {
    }

    @Override
    public void onResume() {
    }

    @Override
    public void onPause() {
    }

    @Override
    public void onDestroy() {
    }

    @Override
    public void onStop() {
    }

}
